import { Injectable } from "@angular/core";
import { Observable } from "rxjs";
import { HttpClient } from "@angular/common/http";

@Injectable()
export class PostService {
  public postDetailURL = "mock-data/post-mock.json";
  public postListURL = "mock-data/postlist-mock.json";
  public postListSearchURL = "mock-data/postlist-search-mock.json";

  constructor(private httpClient: HttpClient) {}

  public getPostList(): Observable<any> {
    return this.httpClient.get(this.postListURL);
  }

  public getPostDetail(): Observable<any> {
    return this.httpClient.get(this.postDetailURL);
  }
}
